﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using System.Web.Script.Serialization;


namespace CodeStash.Common.DataAccess.EntityFramework
{
    [DataContract]
    public partial class Visibility : IEquatable<Visibility>
    {
        public Visibility()
        {
            this.CodeSnippets = new List<CodeSnippet>();
        }

        public Visibility(string visibilityDescription)
        {
            this.VisibilityDescription = visibilityDescription;
            this.CodeSnippets = new List<CodeSnippet>();
        }

        [Key]
        [DataMember]
        public int Id { get; set; }

        [DataMember]
        public string VisibilityDescription { get; set; }

        [DataMember]
        [ScriptIgnore]
        public virtual List<CodeSnippet> CodeSnippets { get; set; }



        #region IEquatable<Visibility> Members

        public bool Equals(Visibility other)
        {
            if (this.Id != other.Id) return false;
            if (this.VisibilityDescription != other.VisibilityDescription) return false;
            return true;

        }

        #endregion
    }
}